package com.xinfan.io.transformation;

import java.io.*;

/**
 * @Author xin
 * @Date 2022/6/9 10:03
 * @Version 1.0
 * 通过转换流解决中文乱码问题
 */
public class InputStreamReader_ {
    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(new FileInputStream("G:\\桌面\\test.txt"),"gbk");//通过字节流指定编码
        BufferedReader br = new BufferedReader(isr);
        String line;

        while ((line = br.readLine()) != null) {
            System.out.println(line);
        }
        br.close();

    }
}
